home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / t-o-p-logo.scm < prev    next >
Encoding:
GIMP Script-Fu Script  |  2005-06-30  |  5.4 KB  |  150 lines

  1. ;;  Trace of Particles Effect
  2. ;; Shuji Narazaki (narazaki@InetQ.or.jp)
  3. ;; Time-stamp: <97/03/15 17:27:33 narazaki@InetQ.or.jp>
  4. ;; Version 0.2
  5.  
  6. (define (apply-t-o-p-logo-effect img
  7.                  logo-layer
  8.                  b-size
  9.                  hit-rate
  10.                  edge-size
  11.                  edge-only
  12.                  base-color
  13.                  bg-color)
  14.   (let* ((width (car (gimp-drawable-width logo-layer)))
  15.      (height (car (gimp-drawable-height logo-layer)))
  16.      (logo-layer-mask (car (gimp-layer-create-mask logo-layer ADD-BLACK-MASK)))
  17.      (sparkle-layer (car (gimp-layer-new img width height RGBA-IMAGE "Sparkle" 100 NORMAL-MODE)))
  18.      (shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Shadow" 90 ADDITION-MODE)))
  19.      (bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
  20.      (selection 0)
  21.      (white '(255 255 255)))
  22.  
  23.     (gimp-context-push)
  24.  
  25.     (script-fu-util-image-resize-from-layer img logo-layer)
  26.     (gimp-image-add-layer img sparkle-layer 2)
  27.     (gimp-image-add-layer img shadow-layer 3)
  28.     (gimp-image-add-layer img bg-layer 4)
  29.     (gimp-selection-none img)
  30.     (gimp-edit-clear shadow-layer)
  31.     (gimp-edit-clear sparkle-layer)
  32.     (gimp-context-set-background base-color)
  33.     (gimp-edit-fill sparkle-layer BACKGROUND-FILL)
  34.     (gimp-selection-layer-alpha logo-layer)
  35.     (set! selection (car (gimp-selection-save img)))
  36.     (gimp-selection-grow img edge-size)
  37.     (plug-in-noisify 1 img sparkle-layer FALSE
  38.              (* 0.1 hit-rate) (* 0.1 hit-rate) (* 0.1 hit-rate) 0.0)
  39.     (gimp-selection-border img edge-size)
  40.     (plug-in-noisify 1 img sparkle-layer FALSE hit-rate hit-rate hit-rate 0.0)
  41.     (gimp-selection-none img)
  42.     (plug-in-sparkle 1 img sparkle-layer 0.03 0.49 width 6 15 1.0 0.0 0.0 0.0 FALSE FALSE FALSE 0)
  43.     (gimp-selection-load selection)
  44.     (gimp-selection-shrink img edge-size)
  45.     (gimp-levels sparkle-layer 0 0 255 1.2 0 255)
  46.     (gimp-selection-load selection)
  47.     (gimp-selection-border img edge-size)
  48.     (gimp-levels sparkle-layer 0 0 255 0.5 0 255)
  49.     (gimp-selection-load selection)
  50.     (gimp-selection-grow img (/ edge-size 2.0))
  51.     (gimp-selection-invert img)
  52.     (gimp-edit-clear sparkle-layer)
  53.     (if (= edge-only TRUE)
  54.     (begin
  55.       (gimp-selection-load selection)
  56.       (gimp-selection-shrink img (/ edge-size 2.0))
  57.       (gimp-edit-clear sparkle-layer)
  58.       (gimp-selection-load selection)
  59.       (gimp-selection-grow img (/ edge-size 2.0))
  60.       (gimp-selection-invert img)))
  61.     (gimp-context-set-foreground '(0 0 0))
  62.     (gimp-context-set-background '(255 255 255))
  63.     (gimp-context-set-brush "Circle Fuzzy (11)")
  64.     (gimp-selection-feather img b-size)
  65.     (gimp-edit-fill shadow-layer BACKGROUND-FILL)
  66.     (gimp-selection-none img)
  67.     (gimp-context-set-background base-color)
  68.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  69.     (gimp-selection-load selection)
  70.     (gimp-context-set-brush "Circle Fuzzy (07)")
  71.     (gimp-context-set-foreground '(255 255 255))
  72.     (gimp-selection-none img)
  73.     (gimp-drawable-set-visible logo-layer 0)
  74.     (gimp-image-set-active-layer img sparkle-layer)
  75.  
  76.     (gimp-context-pop)))
  77.  
  78.  
  79. (define (script-fu-t-o-p-logo-alpha img
  80.                     logo-layer
  81.                     b-size
  82.                     hit-rate
  83.                     edge-size
  84.                     edge-only
  85.                     base-color
  86.                     bg-color)
  87.   (begin
  88.     (gimp-image-undo-group-start img)
  89.     (apply-t-o-p-logo-effect img logo-layer b-size hit-rate
  90.                  edge-size edge-only base-color bg-color)
  91.     (gimp-image-undo-group-end img)
  92.     (gimp-displays-flush)))
  93.  
  94. (script-fu-register "script-fu-t-o-p-logo-alpha"
  95.             _"_Particle Trace..."
  96.             "Trace of Particles Effect"
  97.             "Shuji Narazaki (narazaki@InetQ.or.jp)"
  98.             "Shuji Narazaki"
  99.             "1997"
  100.             "RGBA"
  101.                     SF-IMAGE       "Image"                0
  102.                     SF-DRAWABLE    "Drawable"             0
  103.             SF-ADJUSTMENT _"Border size (pixels)" '(20 1 200 1 10 0 1)
  104.                     SF-ADJUSTMENT _"Hit rate"             '(0.2 0 1 .01 .01 2 0)
  105.                     SF-ADJUSTMENT _"Edge width"           '(2 0 128 1 1 0 0)
  106.             SF-TOGGLE     _"Edge only"            FALSE
  107.             SF-COLOR      _"Base color"           '(0 40 0)
  108.             SF-COLOR      _"Background color"     '(255 255 255))
  109.  
  110. (script-fu-menu-register "script-fu-t-o-p-logo-alpha"
  111.              _"<Image>/Script-Fu/Alpha to Logo")
  112.  
  113.  
  114. (define (script-fu-t-o-p-logo text
  115.                   size
  116.                   fontname
  117.                   hit-rate
  118.                   edge-size
  119.                   edge-only
  120.                   base-color
  121.                   bg-color)
  122.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  123.      (border (/ size 5))
  124.      (text-layer (car (gimp-text-fontname img -1 0 0 text (* border 2) TRUE size PIXELS fontname))))
  125.     (gimp-image-undo-disable img)
  126.     (gimp-drawable-set-name text-layer text)
  127.     (apply-t-o-p-logo-effect img text-layer border hit-rate
  128.                  edge-size edge-only base-color bg-color)
  129.     (gimp-image-undo-enable img)
  130.     (gimp-display-new img)))
  131.  
  132. (script-fu-register "script-fu-t-o-p-logo"
  133.             _"_Particle Trace..."
  134.             "Trace of Particles Effect"
  135.             "Shuji Narazaki (narazaki@InetQ.or.jp)"
  136.             "Shuji Narazaki"
  137.             "1997"
  138.             ""
  139.             SF-STRING     _"Text"               "The GIMP"
  140.             SF-ADJUSTMENT _"Font size (pixels)" '(100 1 1000 1 10 0 1)
  141.             SF-FONT       _"Font"               "Becker"
  142.             SF-ADJUSTMENT _"Hit rate"           '(0.2 0 1 .01 .01 2 0)
  143.             SF-ADJUSTMENT _"Edge width"         '(2 0 128 1 1 0 0)
  144.             SF-TOGGLE     _"Edge only"          FALSE
  145.             SF-COLOR      _"Base color"         '(0 40 0)
  146.             SF-COLOR      _"Background color"   '(255 255 255))
  147.  
  148. (script-fu-menu-register "script-fu-t-o-p-logo"
  149.              _"<Toolbox>/Xtns/Script-Fu/Logos")
  150.